const Service = require('../../../core/service/ApiService');

class CommonDao extends Service {

    //获取社区列表
    async getCommunityList() {
        return this.model.Community.findAll({
            attributes: ['community_id', 'name'],
            raw: true
        })

    }

    //获取小区列表
    async getSubistrictList(com_id) {
        return this.model.Subdistrict.findAll({
            where: {
                community_id: com_id
            },
            attributes: ['subdistrict_id', 'name'],
            raw: true
        })
    }

}

module.exports = CommonDao;
